package com.zbkj.admin.controller.publicly.v2;

import com.zbkj.admin.service.AdminFundV2Service;
import com.zbkj.admin.service.AdminUserV2Service;
import com.zbkj.dal.base.result.CommonResult;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import javax.validation.constraints.NotNull;

@Api("用户管理-通用")
@RestController
@RequestMapping("/api/admin/publicly/v2/user")
public class AdminUserV2Controller {

    @Resource
    private AdminUserV2Service adminUserV2Service;

    @ApiOperation(value = "用户真实姓名")
    @GetMapping(value = "/real-name/{userId}")
    public CommonResult<String> userRealName(@PathVariable(value = "userId") @NotNull(message = "用户id不能为空") Integer userId) {
        return CommonResult.success(adminUserV2Service.userRealName(userId));
    }

    @ApiOperation(value = "用户手机号")
    @GetMapping(value = "/phone/{userId}")
    public CommonResult<String> userPhone(@PathVariable(value = "userId") @NotNull(message = "用户id不能为空") Integer userId) {
        return CommonResult.success(adminUserV2Service.userPhone(userId));
    }

    @ApiOperation(value = "用户手机号")
    @GetMapping(value = "/bankcard-number/{userId}")
    public CommonResult<String> userBankcardNumber(@PathVariable(value = "userId") @NotNull(message = "用户id不能为空") Integer userId) {
        return CommonResult.success(adminUserV2Service.bankcardNumber(userId));
    }

}
